package com.gzhryc.shared_device.bxscn.code.dao.enums;

public class BXSCNShopOrderEnum {

    public static enum LeaseType {
        Unknown(1, "未知"), Appointment(2, "预约到店租借"), Logistics(3, "同城快递租借");

        private Integer index;
        private String note;

        LeaseType(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            LeaseType[] temp = LeaseType.values();
            for (int i = 0; i < temp.length; i++) {
                LeaseType item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum RevertType {
        Unknown(1, "未知"), Appointment(2, "预约到店归还"), Logistics(3, "同城快递归还");

        private Integer index;
        private String note;

        RevertType(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            RevertType[] temp = RevertType.values();
            for (int i = 0; i < temp.length; i++) {
                RevertType item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum State {

        WaitLease(1, "等待租借"), Lease(2, "租借中"),
        WaitRevert(3,"待归还"),RevertFinish(4, "已归还"), LeaseTimeout(5, "租借超时"),
        RevertClose(6, "已归还(超时)"), LeaseClose(7, "未归还(默认购买)"),
        Close(8, "订单异常关闭");

        private Integer index;
        private String note;

        State(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            State[] temp = State.values();
            for (int i = 0; i < temp.length; i++) {
                State item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum PayState {

        WaitPay(1, "等待支付"), DepositSuccess(2, "押金支付成功"),
        DepositRefund(3, "押金退款中"), Cancel(4, "订单撤销"), PaySuccess(5, "支付成功");

        private Integer index;
        private String note;

        PayState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            PayState[] temp = PayState.values();
            for (int i = 0; i < temp.length; i++) {
                PayState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum DeviceState {

        NotStarted(1, "未启动"), WaitResult(2, "等待启动结果"),
        Success(3, "启动成功"), Fail(4, "启动失败");

        private Integer index;
        private String note;

        DeviceState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            DeviceState[] temp = DeviceState.values();
            for (int i = 0; i < temp.length; i++) {
                DeviceState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }
}
